<?php	
	///////////////////////////////////////////////////////////////////////////////////////////////////
	//	SIGN OUT
	//	WRITTEN BY: TRAVIS THORNTON
	//	12-07-2009
	//
	//	What this page does:
	//	1) Destroys session and starts a new one
	//	2) Logs logout if there was a user logged in
	//
	////////////////////////////////////////////////////////////////////////////////////////////////////
	session_start();
	require_once 'php_includes.php';
		
	//log logout only if user was online
	if(isset($_SESSION['tmsUserID']))
	{
		//log that the user is logging out
		logDB("LOGOUT");

		unset($_SESSION['tmsUserID']);
	}

	//kill the session
	session_destroy();
	session_start();
?>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
  <head>
    <title>Payroll and Timesheet Management Website</title>
    <link rel="stylesheet" type="text/css" href="styles.css"/>
  </head>
  <body>
	<?php writeHeader(); ?>
	<p class="message">
		You have been signed out.
	</p>
	<p>
	<a href="main.php">Log back in</a>
	</p>
  </body>
</html>